package lab02.test03;

public class Student {

    private String sname;
    private float computer;
    private float math;
    private float english;


    public String getSname() {
        return sname;
    }

    public void setSname(String sname) {
        this.sname = sname;
    }

    public float getComputer() {
        return computer;
    }

    public void setComputer(float computer) {
        this.computer = computer;
    }

    public float getMath() {
        return math;
    }

    public void setMath(float math) {
        this.math = math;
    }

    public float getEnglish() {
        return english;
    }

    public void setEnglish(float english) {
        this.english = english;
    }

    public void sum() {
        System.out.println("总分：" + (math + english + computer));
    }

    public void average() {
        float sum = math + english + computer;
        System.out.println("平均分：" + sum / 3);
    }

    public void max() {
        if (math >= english && math >= computer) {
                System.out.println("最高分为：" + math);
        } else if (english >= math && english >= computer) {
            System.out.println("最高分为：" + english);
        } else if (computer >= math && computer >= english) {
            System.out.println("最高分为：" + computer);
        }
    }

    public void min() {
        if (math <= english && math <= computer) {
            System.out.println("最低分为：" + math);
        } else if (english <= math && english <= computer) {
            System.out.println("最低分为：" + english);
        } else if (computer <= math && computer <= english) {
            System.out.println("最低分为：" + computer);
        }
    }

    public void print() {
        System.out.println("姓名:" + sname + "   计算机成绩:" +
                computer + "   数学成绩:" + math + "   英语成绩:" + english);

    }

}
